from ultralytics import YOLO

if __name__ == "__main__":

    sizelist = ["n", "s", "m"]
    modellist = ["v8", "11", "12"]
    for m in modellist:

        for size in sizelist:
            modelyaml = "yolo" + m + size + ".yaml"

            # Load a COCO-pretrained YOLO11n model
            model = YOLO(modelyaml)

            # Train the model on the COCO8 example dataset for 100 epochs

            mname = m + size + "_epoch20"

            results = model.train(data="../yaml/data.yaml",
                                  epochs=20,
                                  optimizer="SGD",
                                  project="ccpddetectnew",
                                  name=mname,
                                  close_mosaic=0,
                                  )
